<script>
/**
 * @desc 点击客服时,出现的弹出层,让用户选择
 */
export default {
  name: 'service-layer',
  props: {
    show: Boolean,
    handleClose: Function
  },
  methods: {
    handleLayer(e) {
      console.log(e)
    }
  }
}
</script>

<template>
  <div
    class="service-layer"
    :class="{'show':show}"
  >
    <div class="content-container" :class="{'show':show}">
      <div class="top-cover" @click="handleClose"></div>
      <div class="bottom-content">
        <label id="for-service" for="contact" class="service">在线客服</label>    
        <label class="service">服务时间: 8:30-24:00</label>
        <label class="service bottom" @click="handleClose">取消</label>
      </div>
    </div>
    
    <button open-type="contact" id="contact" />
  </div>
</template>

<style lang="scss" scoped>
.service-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.25s;
  visibility: hidden;
  opacity: 0;
  &.show {
    visibility: visible;
    opacity: 1;
  }

  .content-container {
    display: flex;
    flex-direction: column;
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.25s;
    transform: translateY(100%);
    &.show {
      transform: translateY(0);
    }
  }

  .top-cover {
    flex: 1;
  }
  .bottom-content {
    background-color: $main-background-color;
  }

  .service {
    display: block;
    padding: 20px 0;
    text-align: center;
    font-size: 16px;
    background-color: #fff;
    &:not(:last-child) {
      border-bottom: 1px solid $border-color;
    }

    &.bottom {
      margin-top: 10px;
    }
  }
}
</style>
